﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Taobao.Saver
{
    partial class Manager
    {
        #region Instance
        private static Manager _instance;
        private static object _instanceLock = new object();
        public static Manager Instance
        {
            get
            {
                if (_instance == null)
                {
                    lock (_instanceLock)
                    {
                        if (_instance == null || _instance.isDispose)
                            _instance = new Manager();
                    }
                }
                return _instance;
            }
        }

        public static void Close()
        {
            if (_instance != null && !_instance.isDispose)
                _instance.Dispose();
            _instance = null;
        }
        public static bool isExist()
        {
            return _instance != null;
        }
        #endregion
    }
}
